﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ChoViet.Cms.ViewModels.ContactUsIndexModel>" %>
<%@ Import Namespace="ChoViet.Lib.Helpers" %>
<%@ Import Namespace="ChoViet.Lib.Paging" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Liên hệ từ độc giả
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Header" runat="server">
	Liên hệ từ độc giả
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="Message" runat="server">
    <%=ViewData["MessageInfo"]!=null? "<p class='perror'>"+Html.Encode(ViewData["MessageInfo"])+"</p>":string.Empty%> 
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Toolbar" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%if(ViewData["MessageInfo"]==null){ %>
	<form action="/ArticleCategory/IndexCms" method="post" name="adminForm">
		<table width="100%" class="adminlist">
			<tr>
				<th width="10" align="right">STT</th>
				<th width="30"></th>
				
				<th>
					<%= Html.Sort("Tiêu đề", "Title", ViewData["orderDir"].ToString(), ViewData["order"].ToString())%>
				</th>				
				<th>
					<%= Html.Sort("Người gửi", "Name", ViewData["orderDir"].ToString(), ViewData["order"].ToString())%>
				</th>
				<th width="90">
					<%= Html.Sort("Ngày gửi", "CreatedDate", ViewData["orderDir"].ToString(), ViewData["order"].ToString())%>
				</th>
				<th>Số điện thoại</th>
				<th>Email</th>
				<th width="30">
				    Trạng thái xem
				</th>    
			</tr>
		<% 
			int i = 1;
    		foreach (var item in Model.ContactUss) {
		%>		
			<tr>
				<td align="center">
					<%= i.ToString()%>
				</td>
				 <td align="center">
					<%= Html.ActionImage("Xóa", "icon-24-delete.png", "ContactUs", "Delete", new Dictionary<string, object>() { { "id", Convert.ToInt32(item.ID) } })%>
				</td>
				
				<td>
				    <%= Html.ActionLink(item.Title,"Details", "ContactUs", new {id = item.ID})%>
				    
				</td>
				<td>
				    <%=Html.Encode(item.Name)%>
				</td>
				<td align="center">
					<%= Html.Encode(string.Format("{0:dd/MM/yyyy HH:mm}", item.CreatedDate))%>
				</td>
				<td align="center">
					<img alt="" id="imgPubYN_<%=item.ID %>" src="<%=item.IsView == true ? "/Images/icon-32-apply.png" : "/Images/icon-32-cancel.png" %>" />
				</td>
			</tr>
		<% i++;
            } %>

		</table>
		<%= Html.Hidden("order")%>
		<%= Html.Hidden("orderDir")%>
		<table width="100%">
        <tr>
            <td align="center">
                <div class="pager">
                    <label>
                        Hiển thị #</label>
                    <%
                        int[] pageSizeList = { 1, 5, 10, 15, 20, 25, 50, 100,300,600,1000 };
                    %>
                    <%= Html.DropDownList("PageSize", new SelectList(pageSizeList, Model.ContactUss.PageSize), new { onchange = "document.adminForm.submit();" })%>
                    <%= Html.Pager(Model.ContactUss.PageSize, Model.ContactUss.PageNumber, Model.ContactUss.TotalItemCount)%>
                </div>
            </td>
        </tr>
    </table>
	</form>
<% } %>

</asp:Content>
